home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aac.d64
/
joystick.proc
< prev
next >
Wrap
Text File
|
2007-02-28
|
828b
|
37 lines
9000 // DELETE "0:JOYSTICK.PROC"
9010 // BY ├APTAIN ├OMAL AND FRIENDS
9020 // LIST "0:JOYSTICK.PROC"
9030 // UPDATED VERSION - MATCHES 2.0
9040 PROC JOYSTICK(PORT,REF DIRECTION,REF FIRE) CLOSED
9050 IF PORT=1 THEN // 1
9060 MEM:=PEEK(56321) // 8 2
9070 ELIF PORT=2 THEN // 7 0 3
9080 MEM:=PEEK(56320) // 6 4
9090 ELSE // 5
9100 RETURN // NOT PROPER PORT NUMBER
9110 ENDIF
9120 FIRE:=1-((MEM MOD 32) DIV 16)
9130 // FILE = TRUE IF PRESSED
9140 CASE 15-(MEM MOD 16) OF
9150 WHEN 1
9160 DIRECTION:=1
9170 WHEN 2
9180 DIRECTION:=5
9190 WHEN 4
9200 DIRECTION:=7
9210 WHEN 5
9220 DIRECTION:=8
9230 WHEN 6
9240 DIRECTION:=6
9250 WHEN 8
9260 DIRECTION:=3
9270 WHEN 9
9280 DIRECTION:=2
9290 WHEN 10
9300 DIRECTION:=4
9310 OTHERWISE
9320 DIRECTION:=0
9330 ENDCASE
9340 ENDPROC JOYSTICK
9350 //